using System.Collections;
using Rdl;

namespace GTame.ReportParser
{

    public class DetailsType
    {

        private GroupingType _Grouping;
        private SortingType _Sorting;
        private TableRowsType _TableRows;
        private VisibilityType _Visibility;

        public GroupingType Grouping
        {
            get
            {
                if (_Grouping == null)
                    _Grouping = new GroupingType();
                return _Grouping;
            }
            set
            {
                _Grouping = value;
            }
        }

        public SortingType Sorting
        {
            get
            {
                if (_Sorting == null)
                    _Sorting = new SortingType();
                return _Sorting;
            }
            set
            {
                _Sorting = value;
            }
        }

        public TableRowsType TableRows
        {
            get
            {
                if (_TableRows == null)
                    _TableRows = new TableRowsType();
                return _TableRows;
            }
            set
            {
                _TableRows = value;
            }
        }

        public VisibilityType Visibility
        {
            get
            {
                if (_Visibility == null)
                    _Visibility = new VisibilityType();
                return _Visibility;
            }
            set
            {
                _Visibility = value;
            }
        }

        public DetailsType()
        {
        }

        public DetailsType Write()
        {
            DetailsType detailsType = new DetailsType();
            ArrayList arrayList = new ArrayList();
            if (_Grouping != null)
                arrayList.Add(_Grouping.Write());
            if (_Sorting != null)
                arrayList.Add(_Sorting.Write());
            if (_TableRows != null)
                arrayList.Add(_TableRows.Write());
            if (_Visibility != null)
                arrayList.Add(_Visibility.Write());
            detailsType.Items = arrayList.ToArray();
            arrayList = null;
            return detailsType;
        }

    } // class DetailsType

}

